import request from '@/utils/request'
import i18n from '@/i18n'

export function origin(query) {
  return request({
    url: '/query/data/origin',
    method: 'get',
    params: query
  })
}

// 行程
export function travel(query) {
  return request({
    url: '/query/data/travel',
    method: 'get',
    params: query
  })
}

export function gps(query) {
  return request({
    url: '/query/data/gps',
    method: 'get',
    params: query
  })
}

// 事件
export function event(query) {
  return request({
    url: '/query/data/event',
    method: 'get',
    params: query
  })
}

export function lbs(query) {
  return request({
    url: '/query/data/lbs',
    method: 'get',
    params: query
  })
}

// 属性
export function attribute(query) {
  return request({
    url: '/query/data/attribute',
    method: 'get',
    params: query
  })
}

export function battery(query) {
  return request({
    url: '/query/data/battery',
    method: 'get',
    params: query
  })
}
export function fault(query) {
  return request({
    url: '/query/data/fault',
    method: 'get',
    params: query
  })
}

export const EVENT_TYPES = [
  {"value": 100002, "label": i18n.t('query.eventTypes.alarmLongPositioningTime')}, // GPS定位时间过长报警
  {"value": 100010, "label": i18n.t('query.eventTypes.alarmSensorWrong')}, // SENSOR中心错误报警
  {"value": 100012, "label": i18n.t('query.eventTypes.alarmDeviceReboot')}, // 设备重启
  {"value": 100013, "label": i18n.t('query.eventTypes.alarmDeviceLogin')}, // 设备登录
  {"value": 100014, "label": i18n.t('query.eventTypes.alarmDeviceLogout')}, // 设备登出
  {"value": 700001, "label": i18n.t('query.eventTypes.alarmCarIgnition')}, // 点火
  {"value": 700002, "label": i18n.t('query.eventTypes.alarmCarFlameOut')}, // 熄火
  {"value": 100048, "label": i18n.t('query.eventTypes.alarmDeviceSleep')}, // 设备休眠
  {"value": 100049, "label": i18n.t('query.eventTypes.alarmDeviceWakeup')}, // 设备唤醒
  {"value": 100053, "label": i18n.t('query.eventTypes.alarmRollOver')}, // 疑似翻车
  {"value": 100089, "label": i18n.t('query.eventTypes.alarmLargeBatteryLow')}, // 电池低电量告警
  {"value": 100088, "label": i18n.t('query.eventTypes.alarmLargeBatteryFull')}, // 电池充满告警
  {"value": 900004, "label": i18n.t('query.eventTypes.alarmUpgradeStatus')}, // 升级状态
  {"value": 900008, "label": i18n.t('query.eventTypes.alarmUpgradeProgress')}, // 升级进度
  {"value": 900009, "label": i18n.t('query.eventTypes.ecuUpgradeStatus')}, // ecu升级状态
  {"value": 200001, "label": i18n.t('query.eventTypes.AlarmOverSpeed')}, // 超速报警
  {"value": 200008, "label": i18n.t('query.eventTypes.alarmAccelerate')}, // 急加速报警
  {"value": 200009, "label": i18n.t('query.eventTypes.alarmDecelerate')}, // 急减速/急刹车报警
  {"value": 200010, "label": i18n.t('query.eventTypes.alarmSharpTurn')}, // 急转弯报警
  {"value": 300002, "label": i18n.t('query.eventTypes.alarmCollision')}, // 碰撞报警
  {"value": 300003, "label": i18n.t('query.eventTypes.alarmTowedAwayBegin')}, // 拖车开始报警
  {"value": -300003, "label": i18n.t('query.eventTypes.alarmTowedAwayEnd')}, // 拖车结束报警
  {"value": 300004, "label": i18n.t('query.eventTypes.alarmSos')}, // SOS报警
  {"value": 300005, "label": i18n.t('query.eventTypes.alarmPowerCutOff')}, // 终端主电断电报警
  {"value": 600011, "label": i18n.t('query.eventTypes.alarmVibrationIgnitionOff')}, // 熄火后震动
  {"value": 100057, "label": i18n.t('query.eventTypes.deviceSelfCheck')}, // 设备自检
];
